package com.modai.remote.api;

import com.modai.remote.dto.CommonResponse;
import com.modai.remote.entity.User;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

/**
 * @author ：modai
 * @date ：Created in 2021-6-5 23:48
 * @description：远程用户api
 */
@RequestMapping("/user")
public interface UserAPI {

    @GetMapping("/{userId}")
    CommonResponse<User> getUser(@PathVariable Integer userId);

    @PostMapping
    CommonResponse<String> insertUser(@RequestBody @Validated User user);

    @PutMapping
    CommonResponse<String> updateUser(@RequestBody User user);

    @DeleteMapping
    CommonResponse<String> deleteUser(@RequestParam(value = "userId") Integer userId);

    @RequestMapping(value = "/userNum",method = RequestMethod.GET)
    CommonResponse<Integer> getUserNum();
}
